From: Matthew Daley Date: Sun, 4 May 2014 08:31:46 +0000 (+1200) Subject: xenstat: fix unsigned less-than-0 comparison X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~5056 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=261bf3449737728975a164d0ecde2f3105d2a3c1;p=xen.git xenstat: fix unsigned less-than-0 comparison Commit 1438d36f ("xenstat: Fix buffer over-run with new_domains being negative.") attempted to fix the handling of a negative error result from xc_domain_getinfolist in xenstat_get_node. However, it forgot to change the result variable from an unsigned type to a signed one. Do so, allowing the error result to be handled properly. Signed-off-by: Matthew Daley Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Ian Campbell --- diff --git a/tools/xenstat/libxenstat/src/xenstat.c b/tools/xenstat/libxenstat/src/xenstat.c index e5facb84f5..8072a90047 100644 --- a/tools/xenstat/libxenstat/src/xenstat.c +++ b/tools/xenstat/libxenstat/src/xenstat.c @@ -164,7 +164,7 @@ xenstat_node *xenstat_get_node(xenstat_handle * handle, unsigned int flags) xenstat_node *node; xc_physinfo_t physinfo = { 0 }; xc_domaininfo_t domaininfo[DOMAIN_CHUNK_SIZE]; - unsigned int new_domains; + int new_domains; unsigned int i; /* Create the node */